package web;

import org.apache.wicket.Component;
import org.apache.wicket.PageParameters;
import org.apache.wicket.markup.html.panel.EmptyPanel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.wicketstuff.annotation.mount.MountPath;
import org.wicketstuff.annotation.strategy.MountIndexedParam;
import web.cms.CmsBasePage;
import web.panels.TopMenuPanel;

/**
 * Main page for search results.
 * Has 2 subpanels, results for products and for cms pages.
 */
@MountPath(path = "search")
@SuppressWarnings("serial")
@MountIndexedParam
public final class SearchPageResult extends CmsBasePage {

    public SearchPageResult() {
        super();
        add(new SearchCmsPanel("searchCmsPanel"));
        add(new SearchProductPanel("searchProductPanel"));
    }

    public SearchPageResult(PageParameters params) {
        super();
        add(new SearchCmsPanel("searchCmsPanel", params));
        add(new SearchProductPanel("searchProductPanel", params));
    }

    @Override
    public IModel getPageTitle() {
        return new Model("Výsledky hledání");
    }

    @Override
    public IModel getDescription() {
        return new Model("Výsledky hledání");
    }

    @Override
    public IModel getKeywords() {
        return new Model("Výsledky hledání");
    }

    @Override
    protected Component newTopPanel(String id) {
        return new TopMenuPanel(id, Long.valueOf(0));
    }

    @Override
    protected Component newLeftPanel(String id) {
        return new EmptyPanel(id);
    }

    @Override
    protected Component newRightPanel(String id) {
        return new EmptyPanel(id);
    }
}

